package org.zlb.manager.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.zlb.manager.dao.OrgOperatorDao;
import org.zlb.manager.entity.OrgOperator;

import java.util.List;

/**
 * TODO
 *
 * @author zhoulingbo
 * @date 2021/8/17 17:55
 */
@Component
public class OrgOperatorService {

    @Autowired
    private OrgOperatorDao orgOperatorDao;

    public List<OrgOperator> list() {
        return orgOperatorDao.findAll();
    }

    public OrgOperator item(String operatorCode) {
        return orgOperatorDao.getById(operatorCode);
    }

    public OrgOperator save(OrgOperator operator) {
        return orgOperatorDao.save(operator);
    }

    public void delete(String operatorCode) {
        orgOperatorDao.deleteById(operatorCode);
    }

    public long count() {
        return orgOperatorDao.count();
    }
}
